<?php
include('../mysqli_connect.php');
$teamId = $_GET['teamId'];
$bestPlayer = $_GET['bestPlayer'];
$sql = "select * from team where team_id={$teamId}";
$res = mysqli_query($dbc, $sql);
if (!$res) {
  printf("Error: %s\n", mysqli_error($dbc));
  exit();
}
$result = mysqli_fetch_assoc($res);
if (mysqli_num_rows($res) == 1) {
  $response = array('status' => true, 'message' => '查询球队成功', 'data' => $result, 'name' => $bestPlayer);
  echo json_encode($response);
} else {
  $response = array('status' => false, 'message' => '查询球队失败');
  echo json_encode($response);
}
